<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        .box{
            width: 600px;
            height: 600px;
            border: 1px solid red;
            margin: 0 auto;
            transform-style: preserve-3d;
            position: relative;
            transform: rotateY(30deg) rotateX(30deg); 
            animation: run 5s linear infinite;
        }
        .box div{
            width: 200px;
            height: 200px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-top: -100px;
            margin-left: -100px;
            text-align: center;
            color: white;
            line-height: 200px;
            font-size: 50px;
        }
        .box div:nth-child(1){
            background: rebeccapurple;
            transform: translateZ(100px);
        }
        .box div:nth-child(2){
            background: gold;
            transform: translateX(-100px) rotateY(90deg);
        }
        .box div:nth-child(3){
            background: greenyellow;
            transform: translateY(100px) rotateX(-90deg);;
        }
        .box div:nth-child(4){
            background: red;
            transform: translateY(-100px) rotateX(90deg);
        }
        .box div:nth-child(5){
            background: green;
            transform: translateX(100px) rotateY(-90deg);
        }
        .box div:nth-child(6){
            background: blue;
            transform: translateZ(-100px);
        }

        @keyframes run {
            
            0%{
                transform: rotateY(30deg) rotateX(30deg);  
            }
            50%{
                transform: rotateY(300deg) rotateX(300deg) rotateZ(90deg);  
            }
            100%{
                transform: rotateY(30deg) rotateX(30deg) rotateZ(300deg);  
            }
          
        }


    </style>
</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
    </div>
    
</body>
</html>